<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<div class="row">
	<div class="col-md-12 col-sm-12 col-lg-12 col-xs-12 text-right">
		<t-auth:roleButton />
	</div>
</div>
<script type="text/javascript">
function addData(){
	top.openModal("/billing/completed/detailed?type="+"add","billing_form","订单详情-添加",1200,540);
}

function editData(){
	var id=getKeyId();
	if(isEditor(id)){
		top.openModal("/billing/completed/detailed?key="+id+"&type="+"modify","billing_form","订单详情-修改",1200,540);
	}
}

function selData(){
	var key=getKeyId();
	if(isEditor(key)){
		top.openModal("/billing/completed/detailed?key="+key+"&type="+"check","billing_form","订单详情-查看",1200,540);
	
	}
}

function deleteData(){
	 var id=getKeyId();
	 if (isEditor(id)) {
		 var url = $.getVirtualPath()+"/billing/billing/delete?key="+id;
		 deleteDataEx(url, searchCallback);
    } 
}

function exportData(){
	var url=$.getVirtualPath()+"/billing/billing/exportExcel";
	var data=$("form:first").serialize();
	var cachedId=$.getText(url,data);
	downloadExcel(cachedId);
}

function billingClose(){
	var id=getKeyId();
	if(isEditor(id)){
		var url = $.getVirtualPath()+"/billing/billing/checkBillingState?key="+id;
        var msg =  $.getText(url);
    	if("banClose"==msg){
       		$.showTips("此订单不允许关闭！",1000,"warning");
       	}else{
       		confirm("是否确认关闭订单？",function(result){
    			if(result){
    				var url = $.getVirtualPath()+"/billing/billing/closeBillingByKey";
    			    var msg =  $.getJsonPost(url,"key="+id);
    			    $.showTips(msg.message,1000,msg.resultType);
    			    formSubmit();
    			}
    		});
       	}
	}
}

function returnCargo(){
	var id=getKeyId();
	if(isEditor(id)){
		top.openModal("/billing/billing/returnCargoDetailed?key="+id,"billing_form","退欠货详情",1200,550);
	}
}

function sendOutGoods(){
	var id=getKeyId();
	if(isEditor(id)){
		top.openModal("/billing/billing/sendOutGoodsDetailed?key="+id,"billing_form","发货详情",1200,550);
	}
}


function addPay(){
	var id=getKeyId();
	if(isEditor(id)){
		top.openModal("/billing/billing/addPayDetailed?key="+id+"&paymentState="+"pay","billing_form","付款详情",650,300);
	}
}
</script>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/notifications.jsp"%>
